import os
import time


def mkdir(path):
    if not os.path.exists(path):
        os.makedirs(path)


dirPath = "E:\\learn\\"
filePath = "DC学院数据分析师（入门）"
# 如果目录不存在，则创建
mkdir(dirPath + filePath)
path = "you-get --format=dash-flv -o {} https://www.bilibili.com/video/av49935047/?p={}"
for i in range(12, 33):
    os.system(path.format(dirPath + filePath, i))
    # print(path.format(dirPath + filePath,i) )
    time.sleep(1)

# os.system("you-get - https://www.bilibili.com/video/av37947862/?p=1")
